package com.ruoyi.module.websiteSeller.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.module.websiteSeller.domain.WebsiteSeller;
import com.ruoyi.module.websiteSeller.mapper.WebsiteSellerMapper;
import com.ruoyi.module.websiteSeller.service.IWebsiteSellerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 商户微官网Service业务层处理
 * 
 * @author ${author}
 * @date 2024-01-27
 */
@Service
public class WebsiteSellerServiceImpl implements IWebsiteSellerService
{
    @Resource
    private WebsiteSellerMapper websiteSellerMapper;

    /**
     * 查询商户微官网
     * 
     * @param wSellerId 商户微官网主键
     * @return 商户微官网
     */
    @Override
    public WebsiteSeller selectWebsiteSellerByWSellerId(Long wSellerId)
    {
        return websiteSellerMapper.selectWebsiteSellerByWSellerId(wSellerId);
    }

    /**
     * 查询商户微官网列表
     * 
     * @param websiteSeller 商户微官网
     * @return 商户微官网
     */
    @Override
    public List<WebsiteSeller> selectWebsiteSellerList(WebsiteSeller websiteSeller)
    {
        websiteSeller.setCreateId(SecurityUtils.getUserId());
        return websiteSellerMapper.selectWebsiteSellerList(websiteSeller);
    }

    /**
     * 新增商户微官网
     * 
     * @param websiteSeller 商户微官网
     * @return 结果
     */
    @Override
    public int insertWebsiteSeller(WebsiteSeller websiteSeller)
    {
        websiteSeller.setCreateId(SecurityUtils.getUserId());
        websiteSeller.setCreateTime(DateUtils.getNowDate());
        return websiteSellerMapper.insertWebsiteSeller(websiteSeller);
    }

    /**
     * 修改商户微官网
     * 
     * @param websiteSeller 商户微官网
     * @return 结果
     */
    @Override
    public int updateWebsiteSeller(WebsiteSeller websiteSeller)
    {
        websiteSeller.setUpdateTime(DateUtils.getNowDate());
        websiteSeller.setUpdateId(SecurityUtils.getUserId());
        return websiteSellerMapper.updateWebsiteSeller(websiteSeller);
    }

    /**
     * 批量删除商户微官网
     * 
     * @param wSellerIds 需要删除的商户微官网主键
     * @return 结果
     */
    @Override
    public int deleteWebsiteSellerByWSellerIds(Long[] wSellerIds)
    {
        return websiteSellerMapper.deleteWebsiteSellerByWSellerIds(wSellerIds);
    }

    /**
     * 删除商户微官网信息
     * 
     * @param wSellerId 商户微官网主键
     * @return 结果
     */
    @Override
    public int deleteWebsiteSellerByWSellerId(Long wSellerId)
    {
        return websiteSellerMapper.deleteWebsiteSellerByWSellerId(wSellerId);
    }
}
